<!-- Title Field -->
<div class="form-group col-sm-12">
    {!! Form::label('title', '名称:') !!}
    {!! Form::text('title', null, ['class' => 'form-control']) !!}
</div>

<!-- Pic Field -->
<div class="form-group col-sm-12">
    {!! Form::label('pic', '图片:') !!}
    {!! Form::file('pic') !!}
</div>
<div class="clearfix"></div>

<div class="form-group col-sm-12">
    选择上级分类:
    <select name="pid">
        <option value="0"> 一级分类</option>
        @foreach($categories as $cate)
            <option value="{{ $cate->id }}" {!! isset($category)?($category->pid==$cate->id?'selected="selected"':''):''!!}> {{$cate->title}}</option>
        @endforeach
    </select>
</div>


<div class="form-group col-sm-12">
    {!! Form::label('is_show', '是否显示:') !!}
    {!! Form::radio('is_show', 1,isset($category)?($category->is_show==1?true:false):true) !!} 显示
    {!! Form::radio('is_show', 0,isset($category)?(!$category->is_show?true:false):false) !!} 不显示
</div>

<!-- Sort Field -->
<div class="form-group col-sm-6">
    {!! Form::label('sort', '排序:') !!}
    {!! Form::text('sort', null, ['class' => 'form-control']) !!}
</div>

<!-- Submit Field -->
<div class="form-group col-sm-12">
    {!! Form::submit('保存', ['class' => 'btn btn-primary']) !!}
    <a href="{!! route('categories.index') !!}" class="btn btn-default">取消</a>
</div>
